/*
 * Academic License - for use in teaching, academic research, and meeting
 * course requirements at degree granting institutions only.  Not for
 * government, commercial, or other organizational use.
 *
 * File: smo_cal.h
 *
 * Code generated for Simulink model 'smo_cal'.
 *
 * Model version                  : 1.5
 * Simulink Coder version         : 9.8 (R2022b) 13-May-2022
 * C/C++ source code generated on : Sat Sep 14 17:42:55 2024
 *
 * Target selection: ert.tlc
 * Embedded hardware selection: ARM Compatible->ARM Cortex-M
 * Code generation objectives: Unspecified
 * Validation result: Not run
 */

#ifndef RTW_HEADER_smo_cal_h_
#define RTW_HEADER_smo_cal_h_
#ifndef smo_cal_COMMON_INCLUDES_
#define smo_cal_COMMON_INCLUDES_
#include "rtwtypes.h"
#endif                                 /* smo_cal_COMMON_INCLUDES_ */

/* Macros for accessing real-time model data structure */
#ifndef rtmGetErrorStatus
#define rtmGetErrorStatus(rtm)         ((rtm)->errorStatus)
#endif

#ifndef rtmSetErrorStatus
#define rtmSetErrorStatus(rtm, val)    ((rtm)->errorStatus = (val))
#endif

/* Forward declaration for rtModel */
typedef struct tag_RTM_smo_cal_T RT_MODEL_smo_cal_T;

/* Block signals (default storage) */
typedef struct {
  real32_T Merge;                      /* '<S15>/Merge' */
} B_smo_cal_T;

/* Block states (default storage) for system '<Root>' */
typedef struct {
  real32_T Delay_DSTATE;               /* '<S9>/Delay' */
  real32_T Delay_DSTATE_h;             /* '<Root>/Delay' */
  real32_T DiscreteTimeIntegrator_DSTATE;/* '<S1>/Discrete-Time Integrator' */
  real32_T Delay_DSTATE_f;             /* '<S10>/Delay' */
  real32_T DiscreteTimeIntegrator1_DSTATE;/* '<S1>/Discrete-Time Integrator1' */
  real32_T UnitDelay_DSTATE;           /* '<S18>/Unit Delay' */
  real32_T UnitDelay_DSTATE_b;         /* '<S21>/Unit Delay' */
  uint32_T Delay_DSTATE_g[5];          /* '<S14>/Delay' */
  uint32_T CircBufIdx;                 /* '<S14>/Delay' */
} DW_smo_cal_T;

/* Real-time Model Data Structure */
struct tag_RTM_smo_cal_T {
  const char_T * volatile errorStatus;
};

/* Block signals (default storage) */
extern B_smo_cal_T smo_cal_B;

/* Block states (default storage) */
extern DW_smo_cal_T smo_cal_DW;

/*
 * Exported Global Parameters
 *
 * Note: Exported global parameters are tunable parameters with an exported
 * global storage class designation.  Code generation will declare the memory for
 * these parameters and exports their symbols.
 *
 */
extern real32_T SMO_Kslide;            /* Variable: SMO_Kslide
                                        * Referenced by:
                                        *   '<S3>/Constant'
                                        *   '<S4>/Constant'
                                        *   '<S5>/Constant'
                                        *   '<S6>/Constant'
                                        *   '<S7>/Constant'
                                        *   '<S8>/Constant'
                                        */
extern real32_T SMO_MaxSMCError;       /* Variable: SMO_MaxSMCError
                                        * Referenced by:
                                        *   '<S3>/Constant1'
                                        *   '<S6>/Constant1'
                                        */
extern real32_T SMO_OffsetAngle;       /* Variable: SMO_OffsetAngle
                                        * Referenced by: '<S13>/Constant1'
                                        */

/* Model entry point functions */
extern void smo_cal_initialize(void);
extern void smo_cal_terminate(void);

/* Customized model step function */
extern void smo_cal_step(real32_T arg_Valpha, real32_T arg_Vbata, real32_T
  arg_Ialpha, real32_T arg_Ibeta, real32_T *arg_SMO_Theta, real32_T
  *arg_SMO_Speed);

/* Real-time Model object */
extern RT_MODEL_smo_cal_T *const smo_cal_M;

/*-
 * These blocks were eliminated from the model due to optimizations:
 *
 * Block '<S1>/Scope' : Unused code path elimination
 * Block '<S1>/Scope1' : Unused code path elimination
 * Block '<S1>/Scope2' : Unused code path elimination
 * Block '<S1>/Scope3' : Unused code path elimination
 * Block '<S1>/Scope4' : Unused code path elimination
 * Block '<S1>/Scope5' : Unused code path elimination
 * Block '<S18>/Data Type Duplicate' : Unused code path elimination
 * Block '<S21>/Data Type Duplicate' : Unused code path elimination
 * Block '<S2>/Scope1' : Unused code path elimination
 * Block '<S2>/Scope2' : Unused code path elimination
 * Block '<S15>/Data Type Duplicate' : Unused code path elimination
 * Block '<S15>/Data Type Conversion' : Eliminate redundant data type conversion
 * Block '<S15>/Data Type Conversion1' : Eliminate redundant data type conversion
 * Block '<S15>/Data Type Conversion2' : Eliminate redundant data type conversion
 */

/*-
 * The generated code includes comments that allow you to trace directly
 * back to the appropriate location in the model.  The basic format
 * is <system>/block_name, where system is the system number (uniquely
 * assigned by Simulink) and block_name is the name of the block.
 *
 * Use the MATLAB hilite_system command to trace the generated code back
 * to the model.  For example,
 *
 * hilite_system('<S3>')    - opens system 3
 * hilite_system('<S3>/Kp') - opens and selects block Kp which resides in S3
 *
 * Here is the system hierarchy for this model
 *
 * '<Root>' : 'smo_cal'
 * '<S1>'   : 'smo_cal/Calculate_Ealpha_AND_Ebeta'
 * '<S2>'   : 'smo_cal/Calculate_Speed_AND_Theta_Arctan'
 * '<S3>'   : 'smo_cal/Calculate_Ealpha_AND_Ebeta/If Action Subsystem'
 * '<S4>'   : 'smo_cal/Calculate_Ealpha_AND_Ebeta/If Action Subsystem1'
 * '<S5>'   : 'smo_cal/Calculate_Ealpha_AND_Ebeta/If Action Subsystem2'
 * '<S6>'   : 'smo_cal/Calculate_Ealpha_AND_Ebeta/If Action Subsystem3'
 * '<S7>'   : 'smo_cal/Calculate_Ealpha_AND_Ebeta/If Action Subsystem4'
 * '<S8>'   : 'smo_cal/Calculate_Ealpha_AND_Ebeta/If Action Subsystem5'
 * '<S9>'   : 'smo_cal/Calculate_Ealpha_AND_Ebeta/Subsystem'
 * '<S10>'  : 'smo_cal/Calculate_Ealpha_AND_Ebeta/Subsystem1'
 * '<S11>'  : 'smo_cal/Calculate_Speed_AND_Theta_Arctan/IIR Filter'
 * '<S12>'  : 'smo_cal/Calculate_Speed_AND_Theta_Arctan/IIR Filter1'
 * '<S13>'  : 'smo_cal/Calculate_Speed_AND_Theta_Arctan/Offect_Angle'
 * '<S14>'  : 'smo_cal/Calculate_Speed_AND_Theta_Arctan/Speed Measurement'
 * '<S15>'  : 'smo_cal/Calculate_Speed_AND_Theta_Arctan/atan2'
 * '<S16>'  : 'smo_cal/Calculate_Speed_AND_Theta_Arctan/IIR Filter/IIR Filter'
 * '<S17>'  : 'smo_cal/Calculate_Speed_AND_Theta_Arctan/IIR Filter/IIR Filter/Low-pass'
 * '<S18>'  : 'smo_cal/Calculate_Speed_AND_Theta_Arctan/IIR Filter/IIR Filter/Low-pass/IIR Low Pass Filter'
 * '<S19>'  : 'smo_cal/Calculate_Speed_AND_Theta_Arctan/IIR Filter1/IIR Filter'
 * '<S20>'  : 'smo_cal/Calculate_Speed_AND_Theta_Arctan/IIR Filter1/IIR Filter/Low-pass'
 * '<S21>'  : 'smo_cal/Calculate_Speed_AND_Theta_Arctan/IIR Filter1/IIR Filter/Low-pass/IIR Low Pass Filter'
 * '<S22>'  : 'smo_cal/Calculate_Speed_AND_Theta_Arctan/Offect_Angle/Theta_Limit(0~2*pi)'
 * '<S23>'  : 'smo_cal/Calculate_Speed_AND_Theta_Arctan/Offect_Angle/Theta_Limit(0~2*pi)/If Action Subsystem'
 * '<S24>'  : 'smo_cal/Calculate_Speed_AND_Theta_Arctan/Offect_Angle/Theta_Limit(0~2*pi)/If Action Subsystem1'
 * '<S25>'  : 'smo_cal/Calculate_Speed_AND_Theta_Arctan/Offect_Angle/Theta_Limit(0~2*pi)/If Action Subsystem2'
 * '<S26>'  : 'smo_cal/Calculate_Speed_AND_Theta_Arctan/Speed Measurement/DT_Handle'
 * '<S27>'  : 'smo_cal/Calculate_Speed_AND_Theta_Arctan/Speed Measurement/DT_Handle/floating-point'
 * '<S28>'  : 'smo_cal/Calculate_Speed_AND_Theta_Arctan/atan2/Compare To Constant'
 * '<S29>'  : 'smo_cal/Calculate_Speed_AND_Theta_Arctan/atan2/Compare To Constant1'
 * '<S30>'  : 'smo_cal/Calculate_Speed_AND_Theta_Arctan/atan2/If Action Subsystem'
 * '<S31>'  : 'smo_cal/Calculate_Speed_AND_Theta_Arctan/atan2/per Uint'
 */
#endif                                 /* RTW_HEADER_smo_cal_h_ */

/*
 * File trailer for generated code.
 *
 * [EOF]
 */
